<?php

namespace Sifast\ProjectBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;

class EtatPhysiqueAdmin extends Admin
{
 
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
        ->with('L1')
            ->add('handicape','choice', array(
            'label'=>'Handicapé:',    
            'expanded' => true,
            'choices' => array('1' => 'Oui', '2' => 'Non'),
            'data' => '1',
        ))  
                 ->add('inscritMutuelle','choice', array(
            'label'=>'Inscrit à la mutuelle:',    
            'expanded' => true,
            'choices' => array('1' => 'Oui', '2' => 'Non'),
            'data' => '1',
        ))
       ->end()
                
           
        ->with('L2')        
            ->add('dateDebut', 'date', array(
                    'label'=> 'Date de debut:',
                    'widget' => 'single_text',
                    'format' => 'MM/dd/yyyy',
                    'attr' => array('class' => 'datepicker')
                ))
            ->add('dateFin', 'date', array(
                    'label'=> 'Date de fin:',
                    'widget' => 'single_text',
                    'format' => 'MM/dd/yyyy',
                    'attr' => array('class' => 'datepicker')
                ))
        ->end()    ;
            
    }

    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper
            ->add('handicape')
            ->add('inscritMutuelle')
            ->add('dateDebut')
            ->add('dateFin');
            
    }

    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper
            ->addIdentifier('handicape')
            ->add('inscritMutuelle')
            ->add('dateDebut')
            ->add('dateFin');
            }
}